-
Notifications
You must be signed in to change notification settings - Fork 607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/gamm: Make all internal set functions private #2013
Conversation
s.App.GAMMKeeper.SetParams(s.Ctx, gammtypes.Params{ | ||
PoolCreationFee: sdk.Coins{}, | ||
}) | ||
|
||
bondDenom := s.App.StakingKeeper.BondDenom(s.Ctx) | ||
// TODO: use sdk crypto instead of tendermint to generate address | ||
acc1 := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) | ||
|
||
poolCreationFee := s.App.GAMMKeeper.GetParams(s.Ctx) | ||
s.FundAcc(acc1, poolCreationFee.PoolCreationFee) | ||
params := s.App.GAMMKeeper.GetParams(s.Ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Context:
The use of SetParams
here was unnecessary and was the only thing prevent us from making the function private, so it makes sense to remove it
The rest of the changes here fix the test, which was broken to begin with but was never caught because SetParams
would always set the pool creation fee to zero
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah nice, this is a good fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, needs changelog entry.
Adding a backport label, if we need more things to be backported to get this through, can you backport them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes: #1945 ## What is the purpose of the change I believe these functions were only public because they needed to be for an older SDK version. I think it would be appropriate to make them private now so that they aren't exposed to other modules. ## Brief Changelog - Made the following functions private: `SetParams` `SetPool` `SetTotalLiquidity` `SetDenomLiquidity` - Commented out old upgrade code that prevented `SetParams` and `SetPool` from being made private - Removed use of `SetParams` in a superfluid test ## Testing and Verifying This change is a trivial rework / code cleanup without any test coverage. ## Documentation and Release Note - Does this pull request introduce a new feature or user-facing behavior changes? (no) - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? (no) - How is the feature or change documented? (not documented) (cherry picked from commit 7fb5f82) # Conflicts: # CHANGELOG.md # app/upgrades/v4/upgrade_test.go # app/upgrades/v4/upgrades.go # x/gamm/genesis.go
Closes: #1945
What is the purpose of the change
I believe these functions were only public because they needed to be for an older SDK version. I think it would be appropriate to make them private now so that they aren't exposed to other modules.
Brief Changelog
SetParams
SetPool
SetTotalLiquidity
SetDenomLiquidity
SetParams
andSetPool
from being made privateSetParams
in a superfluid testTesting and Verifying
This change is a trivial rework / code cleanup without any test coverage.
Documentation and Release Note
Unreleased
section inCHANGELOG.md
? (no)